package commoditymanagement;

import java.math.BigDecimal;

public class Commodity {
	private int id;
	private String name;
	private CommodityType type;
	private BigDecimal price;
	private int storeNum;
	
	
	public Commodity() {
		super();
	}
	public Commodity(int id, String name, CommodityType type, BigDecimal price, int storeNum) {
		super();
		this.id = id;
		this.name = name;
		this.type = type;
		this.price = price;
		this.storeNum = storeNum;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public CommodityType getType() {
		return type;
	}
	public void setType(CommodityType type) {
		this.type = type;
	}
	public BigDecimal getPrice() {
		return price;
	}
	public void setPrice(BigDecimal price) {
		this.price = price;
	}
	public int getStoreNum() {
		return storeNum;
	}
	public void setStoreNum(int storeNum) {
		this.storeNum = storeNum;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Commodity other = (Commodity) obj;
		if (id != other.id)
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "Commodity [id=" + id + ", name=" + name + ", type=" + type + ", price=" + price + ", storeNum="
				+ storeNum + "]\n";
	}
}
